/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// pmlchart.hpp - Multi line chart class definition 
//
// Author: Jim DeLisle
//
// Copyright (c) 1997-2003 Swell Software 
//              All Rights Reserved.
//
// Unauthorized redistribution of this source code, in whole or part,
// without the express written permission of Swell Software
// is strictly prohibited.
//
// Notes:
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/

#ifndef _PEGMULTILINECHART_
#define _PEGMULTILINECHART_

/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
class PegMultiLineChart : public PegChart
{
    public:
        PegMultiLineChart(const PegRect &Size, PEGLONG MinX, PEGLONG MaxX,
                          PEGLONG MinY, PEGLONG MaxY, PEGUINT XScale = 0,
                          PEGUINT YScale = 0);
        virtual ~PegMultiLineChart();
    
        virtual PEGUBYTE AddLine(PEGCOLOR Color);
        PegChartPoint* AddPoint(PEGUBYTE ID, PEGLONG X, PEGLONG Y, 
                                PEGBOOL Redraw = TRUE);

        virtual void Draw(const PegRect &Invalid);
        void DrawNewLineData(PegChartLine* pLine, PegChartPoint* pNew, 
                             PegChartPoint* pPrevious = NULL);

        PegChartLine* GetFirstLine() const { return mpLines; }
        PegChartLine* GetLineFromID(PEGUBYTE ID);
        PegChartPoint* InsertPoint(PEGUBYTE ID, PegChartPoint* pPreviousPoint,
                                   PEGLONG X, PEGLONG Y, 
                                   PEGBOOL Redraw = TRUE);

        virtual PEGINT Message(const PegMessage &Mesg);

        void RecalcLine(PEGUBYTE ID, PEGBOOL Redraw = TRUE);
        virtual void RecalcSize(const PegRect &NewSize, PEGBOOL Redraw = TRUE);
        PEGBOOL RemoveLine(PEGUBYTE ID);
        PegChartPoint* RemovePoint(PEGUBYTE ID, PegChartPoint* pPoint, 
                                   PEGBOOL Redraw = TRUE);

        void ResetAllLines(PEGBOOL Redraw = TRUE);
        void ResetLine(PEGUBYTE ID, PEGBOOL Redraw = TRUE);
        virtual void Resize(const PegRect &NewSize);

    protected:
        PegChartLine* mpLines;
        PEGULONG mLineIDs[8];
};

#endif // _PEGMULTILINECHART_


